package chapter04;

public class Java12_Object_Extends_01 {
    public static void main(String[] args) {
        // 如果父类和子类含有相同的属性，那么可以采用关键字进行区分
        // super、this:JVM默认调用this
        Child01 child01 = new Child01();
        System.out.println(child01.name);
        child01.test();
    }
}
class Person01 {
    String name = "张三";
}
class Child01 extends Person01 {
    String name = "李四";

    void test() {
        System.out.println(super.name);
        System.out.println(this.name);
    }
}